﻿
namespace NetROS.Tiers.Windows.Forms
{
	/// <summary>
	/// abstract ObracunOsobaPrimanje typed datagridview
	/// </summary>
	[System.ComponentModel.DesignerCategoryAttribute("code")]
	public abstract class ObracunOsobaPrimanjeDataGridViewBase : System.Windows.Forms.UserControl
	{	
		/// <summary> 
		/// Thrown when the current Entity changed.
		/// </summary>
		public event System.EventHandler<ObracunOsobaPrimanjeDataGridViewEventArgs> CurrentEntityChanged;
		
		#region Fields
				
		/// <summary> 
		/// the current entity.
		/// </summary>
		private Entities.ObracunOsobaPrimanje _currentObracunOsobaPrimanje = null;
		//private Dictionary<string, string> _columnsHeaders = new Dictionary<string, string>();
		
		/// <summary> 
		/// the datagridview instance
		/// </summary>
		protected System.Windows.Forms.DataGridView uxObracunOsobaPrimanjeDataGridView;
		
		/// <summary> 
		/// the errorprovider
		/// </summary>
		protected System.Windows.Forms.ErrorProvider uxObracunOsobaPrimanjeErrorProvider;
		
		/// <summary> 
		/// the bindingsource
		/// </summary>
		protected System.Windows.Forms.BindingSource uxObracunOsobaPrimanjeBindingSource;
		
		
		/// <summary> 
		/// the DGV column associated with the ID property
		/// </summary>
		protected System.Windows.Forms.DataGridViewTextBoxColumn uxIDDataGridViewColumn;
		/// <summary> 
		/// the DGV column associated with the IDObracunOsoba property
		/// </summary>
		protected System.Windows.Forms.DataGridViewComboBoxColumn uxIDObracunOsobaDataGridViewColumn;
		/// <summary> 
		/// the DGV column associated with the IDPrimanjeTip property
		/// </summary>
		protected System.Windows.Forms.DataGridViewComboBoxColumn uxIDPrimanjeTipDataGridViewColumn;
		
		/// <summary> 
		/// the DGV column associated with the Sati property
		/// </summary>
		protected System.Windows.Forms.DataGridViewTextBoxColumn uxSatiDataGridViewColumn;
		
		/// <summary> 
		/// the DGV column associated with the Postotak property
		/// </summary>
		protected System.Windows.Forms.DataGridViewTextBoxColumn uxPostotakDataGridViewColumn;
		
		/// <summary> 
		/// the DGV column associated with the Satnica property
		/// </summary>
		protected System.Windows.Forms.DataGridViewTextBoxColumn uxSatnicaDataGridViewColumn;
		
		/// <summary> 
		/// the DGV column associated with the DatumOd property
		/// </summary>
		protected System.Windows.Forms.DataGridViewTextBoxColumn uxDatumOdDataGridViewColumn;
		
		/// <summary> 
		/// the DGV column associated with the DatumDo property
		/// </summary>
		protected System.Windows.Forms.DataGridViewTextBoxColumn uxDatumDoDataGridViewColumn;
		
		/// <summary> 
		/// the DGV column associated with the Iznos property
		/// </summary>
		protected System.Windows.Forms.DataGridViewTextBoxColumn uxIznosDataGridViewColumn;
		
		/// <summary> 
		/// the DGV column associated with the StazMjeseci1 property
		/// </summary>
		protected System.Windows.Forms.DataGridViewTextBoxColumn uxStazMjeseci1DataGridViewColumn;
		
		/// <summary> 
		/// the DGV column associated with the StazMjeseci2 property
		/// </summary>
		protected System.Windows.Forms.DataGridViewTextBoxColumn uxStazMjeseci2DataGridViewColumn;
		
		/// <summary> 
		/// the DGV column associated with the MIO1 property
		/// </summary>
		protected System.Windows.Forms.DataGridViewCheckBoxColumn uxMIO1DataGridViewColumn;
		
		/// <summary> 
		/// the DGV column associated with the MIO2 property
		/// </summary>
		protected System.Windows.Forms.DataGridViewCheckBoxColumn uxMIO2DataGridViewColumn;
		
		/// <summary> 
		/// the DGV column associated with the BrojDanaInozemstva property
		/// </summary>
		protected System.Windows.Forms.DataGridViewTextBoxColumn uxBrojDanaInozemstvaDataGridViewColumn;
		
		/// <summary> 
		/// the DGV column associated with the StazSPovecanimTrajanjemRegos property
		/// </summary>
		protected System.Windows.Forms.DataGridViewTextBoxColumn uxStazSPovecanimTrajanjemRegosDataGridViewColumn;
		
		/// <summary> 
		/// the DGV column associated with the IznosSOsobaPlace property
		/// </summary>
		protected System.Windows.Forms.DataGridViewTextBoxColumn uxIznosSOsobaPlaceDataGridViewColumn;
		
		/// <summary> 
		/// the DGV column associated with the DnevnoRadnihSatiSOsobaplaca property
		/// </summary>
		protected System.Windows.Forms.DataGridViewTextBoxColumn uxDnevnoRadnihSatiSOsobaplacaDataGridViewColumn;
		
		/// <summary> 
		/// the DGV column associated with the OriginalniIznos property
		/// </summary>
		protected System.Windows.Forms.DataGridViewTextBoxColumn uxOriginalniIznosDataGridViewColumn;
		
		/// <summary> 
		/// the DGV column associated with the DoprinosNaPlace property
		/// </summary>
		protected System.Windows.Forms.DataGridViewCheckBoxColumn uxDoprinosNaPlaceDataGridViewColumn;
		
		#endregion
					
		#region Combo list
		
				
		private Entities.TList<Entities.ObracunOsoba> _IDObracunOsobaList;
		
		/// <summary> 
		/// The list of selectable ObracunOsoba
		/// </summary>
		[System.ComponentModel.Category("DropDownList BindingSources")]
		public Entities.TList<Entities.ObracunOsoba> IDObracunOsobaList
		{
			get {return this._IDObracunOsobaList;}
			set 
			{
				this._IDObracunOsobaList = value;
				this.uxIDObracunOsobaDataGridViewColumn.DataSource = null;
				this.uxIDObracunOsobaDataGridViewColumn.DataSource = this._IDObracunOsobaList;
			}
		}
		
		private bool _allowNewItemInIDObracunOsobaList;
		
		/// <summary> 
		/// Indicates if user can add an item in the list of ObracunOsoba
		/// </summary>
		[System.ComponentModel.Category(".netTiers"), System.ComponentModel.Description("Indicates if end user can add a new item in the combobox. an event will be thrown then.")]
		public bool AllowNewItemInIDObracunOsobaList
		{
			get { return _allowNewItemInIDObracunOsobaList;}
			set
			{
				this._allowNewItemInIDObracunOsobaList = value;
				this.uxIDObracunOsobaDataGridViewColumn.DisplayStyle = value ? System.Windows.Forms.DataGridViewComboBoxDisplayStyle.ComboBox : System.Windows.Forms.DataGridViewComboBoxDisplayStyle.DropDownButton;
			}
		}
		
				
		private Entities.TList<Entities.PrimanjeTip> _IDPrimanjeTipList;
		
		/// <summary> 
		/// The list of selectable PrimanjeTip
		/// </summary>
		[System.ComponentModel.Category("DropDownList BindingSources")]
		public Entities.TList<Entities.PrimanjeTip> IDPrimanjeTipList
		{
			get {return this._IDPrimanjeTipList;}
			set 
			{
				this._IDPrimanjeTipList = value;
				this.uxIDPrimanjeTipDataGridViewColumn.DataSource = null;
				this.uxIDPrimanjeTipDataGridViewColumn.DataSource = this._IDPrimanjeTipList;
			}
		}
		
		private bool _allowNewItemInIDPrimanjeTipList;
		
		/// <summary> 
		/// Indicates if user can add an item in the list of PrimanjeTip
		/// </summary>
		[System.ComponentModel.Category(".netTiers"), System.ComponentModel.Description("Indicates if end user can add a new item in the combobox. an event will be thrown then.")]
		public bool AllowNewItemInIDPrimanjeTipList
		{
			get { return _allowNewItemInIDPrimanjeTipList;}
			set
			{
				this._allowNewItemInIDPrimanjeTipList = value;
				this.uxIDPrimanjeTipDataGridViewColumn.DisplayStyle = value ? System.Windows.Forms.DataGridViewComboBoxDisplayStyle.ComboBox : System.Windows.Forms.DataGridViewComboBoxDisplayStyle.DropDownButton;
			}
		}
		
		#endregion
		
		#region Main Datasource
		
		private Entities.TList<Entities.ObracunOsobaPrimanje> _ObracunOsobaPrimanjeList;
				
		/// <summary> 
		/// The list of ObracunOsobaPrimanje to be displayed in the DGV.
		/// </summary>
		[System.ComponentModel.Category("Data")]
		public Entities.TList<Entities.ObracunOsobaPrimanje> ObracunOsobaPrimanjeList
		{
			get {return this._ObracunOsobaPrimanjeList;}
			set
			{
				this._ObracunOsobaPrimanjeList = value;
				this.uxObracunOsobaPrimanjeBindingSource.DataSource = null;
				this.uxObracunOsobaPrimanjeBindingSource.DataSource = value;
				this.uxObracunOsobaPrimanjeDataGridView.DataSource = null;
				this.uxObracunOsobaPrimanjeDataGridView.DataSource = this.uxObracunOsobaPrimanjeBindingSource;				
				//this.uxObracunOsobaPrimanjeBindingSource.ListChanged += new System.ComponentModel.ListChangedEventHandler(uxObracunOsobaPrimanjeBindingSource_ListChanged);
				this.uxObracunOsobaPrimanjeBindingSource.CurrentItemChanged += new System.EventHandler(OnObracunOsobaPrimanjeBindingSourceCurrentItemChanged);
			}
		}
		
		private void OnObracunOsobaPrimanjeBindingSourceCurrentItemChanged(object sender, System.EventArgs e)
		{
			_currentObracunOsobaPrimanje = uxObracunOsobaPrimanjeBindingSource.Current as Entities.ObracunOsobaPrimanje;
			
			if (_currentObracunOsobaPrimanje != null)
			{
				_currentObracunOsobaPrimanje.Validate();
			}
			//_ObracunOsobaPrimanje.Validate();
			OnCurrentEntityChanged();
		}

		//void uxObracunOsobaPrimanjeBindingSource_ListChanged(object sender, System.ComponentModel.ListChangedEventArgs e)
		//{
			//throw new Exception("The method or operation is not implemented.");
		//}		
		
		#endregion
		
		/// <summary>
		/// Gets the currently selected <c cref="Entities.ObracunOsobaPrimanje"/> instance.
		/// </summary>
		public Entities.ObracunOsobaPrimanje SelectedObracunOsobaPrimanje
		{
			get {return this._currentObracunOsobaPrimanje;}
		}
		
		#region other properties
		
		/// <summary>
		/// Gets or sets a value indicating whether you have provided your own data-management operations for the DataGridView control.
		/// </summary>
		[System.ComponentModel.Category(".netTiers")]
		public bool VirtualMode
		{
			get {return this.uxObracunOsobaPrimanjeDataGridView.VirtualMode;}
			set
			{
				this.uxObracunOsobaPrimanjeDataGridView.VirtualMode = value;
			}
		}
		
		/// <summary>
		/// Gets or sets a value indicating whether the option to add rows is displayed to the user.
		/// </summary>
		[System.ComponentModel.Category(".netTiers")]
		public bool AllowUserToAddRows
		{
			get {return this.uxObracunOsobaPrimanjeDataGridView.AllowUserToAddRows;}
			set {this.uxObracunOsobaPrimanjeDataGridView.AllowUserToAddRows = value;}
		}
		
		/// <summary>
		/// Gets or sets a value indicating whether the user is allowed to delete rows from the DataGridView.
		/// </summary>
		[System.ComponentModel.Category(".netTiers")]
		public bool AllowUserToDeleteRows
		{
			get {return this.uxObracunOsobaPrimanjeDataGridView.AllowUserToDeleteRows;}
			set {this.uxObracunOsobaPrimanjeDataGridView.AllowUserToDeleteRows = value;}
		}
		
		/// <summary>
		/// Gets the <c cref="DataGridView"/> instance.
		/// </summary>
		[System.ComponentModel.Category(".netTiers")]
		public System.Windows.Forms.DataGridView DataGridView
		{
			get {return this.uxObracunOsobaPrimanjeDataGridView;}
		}
		
		/// <summary>
		/// Gets a collection that contains all the columns in the control.
		/// </summary>
		[System.ComponentModel.Category(".netTiers")]		
		[System.ComponentModel.DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Visible)]
		//[System.ComponentModel.EditorAttribute("System.Windows.Forms.Design.DataGridViewColumnCollectionEditor, System.Design", typeof(System.Drawing.Design.UITypeEditor))] 
		public System.Windows.Forms.DataGridViewColumnCollection Columns
		{
			get { return this.uxObracunOsobaPrimanjeDataGridView.Columns; }
		}
		
		#endregion
		
		/// <summary> 
		/// Required designer variable.
		/// </summary>
		private System.ComponentModel.IContainer components = null;
	
		/// <summary> 
		/// Clean up any resources being used.
		/// </summary>
		/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
		protected override void Dispose(bool disposing)
		{
			if (disposing && (components != null))
			{
				components.Dispose();
			}
			base.Dispose(disposing);
		}
	
		#region Constructor
	
		/// <summary>
		/// Initializes a new instance of the <see cref="ObracunOsobaPrimanjeDataGridViewBase"/> class.
		/// </summary>
		public ObracunOsobaPrimanjeDataGridViewBase()
		{			
			this.components = new System.ComponentModel.Container();			
			
			this.uxObracunOsobaPrimanjeDataGridView = new System.Windows.Forms.DataGridView();
			this.uxObracunOsobaPrimanjeBindingSource = new System.Windows.Forms.BindingSource(this.components);
			this.uxObracunOsobaPrimanjeErrorProvider = new System.Windows.Forms.ErrorProvider(this.components);
			this.uxIDDataGridViewColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
			this.uxIDObracunOsobaDataGridViewColumn = new System.Windows.Forms.DataGridViewComboBoxColumn();
			this.uxIDPrimanjeTipDataGridViewColumn = new System.Windows.Forms.DataGridViewComboBoxColumn();
			this.uxSatiDataGridViewColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
			this.uxPostotakDataGridViewColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
			this.uxSatnicaDataGridViewColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
			this.uxDatumOdDataGridViewColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
			this.uxDatumDoDataGridViewColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
			this.uxIznosDataGridViewColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
			this.uxStazMjeseci1DataGridViewColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
			this.uxStazMjeseci2DataGridViewColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
			this.uxMIO1DataGridViewColumn = new System.Windows.Forms.DataGridViewCheckBoxColumn();
			this.uxMIO2DataGridViewColumn = new System.Windows.Forms.DataGridViewCheckBoxColumn();
			this.uxBrojDanaInozemstvaDataGridViewColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
			this.uxStazSPovecanimTrajanjemRegosDataGridViewColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
			this.uxIznosSOsobaPlaceDataGridViewColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
			this.uxDnevnoRadnihSatiSOsobaplacaDataGridViewColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
			this.uxOriginalniIznosDataGridViewColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
			this.uxDoprinosNaPlaceDataGridViewColumn = new System.Windows.Forms.DataGridViewCheckBoxColumn();
			//this.uxIDObracunOsobaBindingSource = new ObracunOsobaBindingSource(this.components);
			//((System.ComponentModel.ISupportInitialize)(this.uxIDObracunOsobaBindingSource)).BeginInit();
			//this.uxIDPrimanjeTipBindingSource = new PrimanjeTipBindingSource(this.components);
			//((System.ComponentModel.ISupportInitialize)(this.uxIDPrimanjeTipBindingSource)).BeginInit();
			((System.ComponentModel.ISupportInitialize)(this.uxObracunOsobaPrimanjeDataGridView)).BeginInit();
			((System.ComponentModel.ISupportInitialize)(this.uxObracunOsobaPrimanjeBindingSource)).BeginInit();
			((System.ComponentModel.ISupportInitialize)(this.uxObracunOsobaPrimanjeErrorProvider)).BeginInit();
			this.SuspendLayout();
						
			// 
			// uxObracunOsobaPrimanjeErrorProvider
			// 
			this.uxObracunOsobaPrimanjeErrorProvider.ContainerControl = this;
			this.uxObracunOsobaPrimanjeErrorProvider.DataSource = this.uxObracunOsobaPrimanjeBindingSource;						
			// 
			// uxObracunOsobaPrimanjeDataGridView
			// 
			this.uxObracunOsobaPrimanjeDataGridView.AutoGenerateColumns = false;
			this.uxObracunOsobaPrimanjeDataGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
			this.uxObracunOsobaPrimanjeDataGridView.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
		this.uxIDDataGridViewColumn,
		this.uxIDObracunOsobaDataGridViewColumn,
		this.uxIDPrimanjeTipDataGridViewColumn,
		this.uxSatiDataGridViewColumn,
		this.uxPostotakDataGridViewColumn,
		this.uxSatnicaDataGridViewColumn,
		this.uxDatumOdDataGridViewColumn,
		this.uxDatumDoDataGridViewColumn,
		this.uxIznosDataGridViewColumn,
		this.uxStazMjeseci1DataGridViewColumn,
		this.uxStazMjeseci2DataGridViewColumn,
		this.uxMIO1DataGridViewColumn,
		this.uxMIO2DataGridViewColumn,
		this.uxBrojDanaInozemstvaDataGridViewColumn,
		this.uxStazSPovecanimTrajanjemRegosDataGridViewColumn,
		this.uxIznosSOsobaPlaceDataGridViewColumn,
		this.uxDnevnoRadnihSatiSOsobaplacaDataGridViewColumn,
		this.uxOriginalniIznosDataGridViewColumn,
		this.uxDoprinosNaPlaceDataGridViewColumn			});
			this.uxObracunOsobaPrimanjeDataGridView.Dock = System.Windows.Forms.DockStyle.Fill;
			this.uxObracunOsobaPrimanjeDataGridView.Location = new System.Drawing.Point(0, 0);
			this.uxObracunOsobaPrimanjeDataGridView.Name = "uxObracunOsobaPrimanjeDataGridView";
			this.uxObracunOsobaPrimanjeDataGridView.Size = new System.Drawing.Size(470, 300);
			this.uxObracunOsobaPrimanjeDataGridView.TabIndex = 0;	
			this.uxObracunOsobaPrimanjeDataGridView.BackgroundColor = System.Drawing.Color.WhiteSmoke;
			this.uxObracunOsobaPrimanjeDataGridView.EnableHeadersVisualStyles = false;
			this.uxObracunOsobaPrimanjeDataGridView.DataError += new System.Windows.Forms.DataGridViewDataErrorEventHandler(this.OnObracunOsobaPrimanjeDataGridViewDataError);
			this.uxObracunOsobaPrimanjeDataGridView.CellValueNeeded += new System.Windows.Forms.DataGridViewCellValueEventHandler(this.OnObracunOsobaPrimanjeDataGridViewCellValueNeeded);
			this.uxObracunOsobaPrimanjeDataGridView.CellValuePushed += new System.Windows.Forms.DataGridViewCellValueEventHandler(this.OnObracunOsobaPrimanjeDataGridViewCellValuePushed);
			
			//
			// uxIDDataGridViewColumn
			//
			this.uxIDDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxIDDataGridViewColumn.DataPropertyName = "ID";
			this.uxIDDataGridViewColumn.HeaderText = "ID";
			this.uxIDDataGridViewColumn.Name = "uxIDDataGridViewColumn";
			this.uxIDDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxIDDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxIDDataGridViewColumn.ReadOnly = true;		
			//
			// uxIDObracunOsobaDataGridViewColumn
			//
			this.uxIDObracunOsobaDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxIDObracunOsobaDataGridViewColumn.DataPropertyName = "IDObracunOsoba";
			this.uxIDObracunOsobaDataGridViewColumn.HeaderText = "IDObracunOsoba";
			this.uxIDObracunOsobaDataGridViewColumn.Name = "uxIDObracunOsobaDataGridViewColumn";
			this.uxIDObracunOsobaDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxIDObracunOsobaDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxIDObracunOsobaDataGridViewColumn.ReadOnly = false;		
			//
			// uxIDPrimanjeTipDataGridViewColumn
			//
			this.uxIDPrimanjeTipDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxIDPrimanjeTipDataGridViewColumn.DataPropertyName = "IDPrimanjeTip";
			this.uxIDPrimanjeTipDataGridViewColumn.HeaderText = "IDPrimanjeTip";
			this.uxIDPrimanjeTipDataGridViewColumn.Name = "uxIDPrimanjeTipDataGridViewColumn";
			this.uxIDPrimanjeTipDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxIDPrimanjeTipDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxIDPrimanjeTipDataGridViewColumn.ReadOnly = false;		
			//
			// uxSatiDataGridViewColumn
			//
			this.uxSatiDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxSatiDataGridViewColumn.DataPropertyName = "Sati";
			this.uxSatiDataGridViewColumn.HeaderText = "Sati";
			this.uxSatiDataGridViewColumn.Name = "uxSatiDataGridViewColumn";
			this.uxSatiDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxSatiDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxSatiDataGridViewColumn.ReadOnly = false;		
			//
			// uxPostotakDataGridViewColumn
			//
			this.uxPostotakDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxPostotakDataGridViewColumn.DataPropertyName = "Postotak";
			this.uxPostotakDataGridViewColumn.HeaderText = "Postotak";
			this.uxPostotakDataGridViewColumn.Name = "uxPostotakDataGridViewColumn";
			this.uxPostotakDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxPostotakDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxPostotakDataGridViewColumn.ReadOnly = false;		
			//
			// uxSatnicaDataGridViewColumn
			//
			this.uxSatnicaDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxSatnicaDataGridViewColumn.DataPropertyName = "Satnica";
			this.uxSatnicaDataGridViewColumn.HeaderText = "Satnica";
			this.uxSatnicaDataGridViewColumn.Name = "uxSatnicaDataGridViewColumn";
			this.uxSatnicaDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxSatnicaDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxSatnicaDataGridViewColumn.ReadOnly = false;		
			//
			// uxDatumOdDataGridViewColumn
			//
			this.uxDatumOdDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxDatumOdDataGridViewColumn.DataPropertyName = "DatumOd";
			this.uxDatumOdDataGridViewColumn.HeaderText = "DatumOd";
			this.uxDatumOdDataGridViewColumn.Name = "uxDatumOdDataGridViewColumn";
			this.uxDatumOdDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxDatumOdDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxDatumOdDataGridViewColumn.ReadOnly = false;		
			//
			// uxDatumDoDataGridViewColumn
			//
			this.uxDatumDoDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxDatumDoDataGridViewColumn.DataPropertyName = "DatumDo";
			this.uxDatumDoDataGridViewColumn.HeaderText = "DatumDo";
			this.uxDatumDoDataGridViewColumn.Name = "uxDatumDoDataGridViewColumn";
			this.uxDatumDoDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxDatumDoDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxDatumDoDataGridViewColumn.ReadOnly = false;		
			//
			// uxIznosDataGridViewColumn
			//
			this.uxIznosDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxIznosDataGridViewColumn.DataPropertyName = "Iznos";
			this.uxIznosDataGridViewColumn.HeaderText = "Iznos";
			this.uxIznosDataGridViewColumn.Name = "uxIznosDataGridViewColumn";
			this.uxIznosDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxIznosDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxIznosDataGridViewColumn.ReadOnly = false;		
			//
			// uxStazMjeseci1DataGridViewColumn
			//
			this.uxStazMjeseci1DataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxStazMjeseci1DataGridViewColumn.DataPropertyName = "StazMjeseci1";
			this.uxStazMjeseci1DataGridViewColumn.HeaderText = "StazMjeseci1";
			this.uxStazMjeseci1DataGridViewColumn.Name = "uxStazMjeseci1DataGridViewColumn";
			this.uxStazMjeseci1DataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxStazMjeseci1DataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxStazMjeseci1DataGridViewColumn.ReadOnly = false;		
			//
			// uxStazMjeseci2DataGridViewColumn
			//
			this.uxStazMjeseci2DataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxStazMjeseci2DataGridViewColumn.DataPropertyName = "StazMjeseci2";
			this.uxStazMjeseci2DataGridViewColumn.HeaderText = "StazMjeseci2";
			this.uxStazMjeseci2DataGridViewColumn.Name = "uxStazMjeseci2DataGridViewColumn";
			this.uxStazMjeseci2DataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxStazMjeseci2DataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxStazMjeseci2DataGridViewColumn.ReadOnly = false;		
			//
			// uxMIO1DataGridViewColumn
			//
			this.uxMIO1DataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxMIO1DataGridViewColumn.DataPropertyName = "MIO1";
			this.uxMIO1DataGridViewColumn.HeaderText = "MIO1";
			this.uxMIO1DataGridViewColumn.Name = "uxMIO1DataGridViewColumn";
			this.uxMIO1DataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxMIO1DataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxMIO1DataGridViewColumn.ReadOnly = false;		
			//
			// uxMIO2DataGridViewColumn
			//
			this.uxMIO2DataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxMIO2DataGridViewColumn.DataPropertyName = "MIO2";
			this.uxMIO2DataGridViewColumn.HeaderText = "MIO2";
			this.uxMIO2DataGridViewColumn.Name = "uxMIO2DataGridViewColumn";
			this.uxMIO2DataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxMIO2DataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxMIO2DataGridViewColumn.ReadOnly = false;		
			//
			// uxBrojDanaInozemstvaDataGridViewColumn
			//
			this.uxBrojDanaInozemstvaDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxBrojDanaInozemstvaDataGridViewColumn.DataPropertyName = "BrojDanaInozemstva";
			this.uxBrojDanaInozemstvaDataGridViewColumn.HeaderText = "BrojDanaInozemstva";
			this.uxBrojDanaInozemstvaDataGridViewColumn.Name = "uxBrojDanaInozemstvaDataGridViewColumn";
			this.uxBrojDanaInozemstvaDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxBrojDanaInozemstvaDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxBrojDanaInozemstvaDataGridViewColumn.ReadOnly = false;		
			//
			// uxStazSPovecanimTrajanjemRegosDataGridViewColumn
			//
			this.uxStazSPovecanimTrajanjemRegosDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxStazSPovecanimTrajanjemRegosDataGridViewColumn.DataPropertyName = "StazSPovecanimTrajanjemRegos";
			this.uxStazSPovecanimTrajanjemRegosDataGridViewColumn.HeaderText = "StazSPovecanimTrajanjemRegos";
			this.uxStazSPovecanimTrajanjemRegosDataGridViewColumn.Name = "uxStazSPovecanimTrajanjemRegosDataGridViewColumn";
			this.uxStazSPovecanimTrajanjemRegosDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxStazSPovecanimTrajanjemRegosDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxStazSPovecanimTrajanjemRegosDataGridViewColumn.ReadOnly = false;		
			//
			// uxIznosSOsobaPlaceDataGridViewColumn
			//
			this.uxIznosSOsobaPlaceDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxIznosSOsobaPlaceDataGridViewColumn.DataPropertyName = "IznosSOsobaPlace";
			this.uxIznosSOsobaPlaceDataGridViewColumn.HeaderText = "IznosSOsobaPlace";
			this.uxIznosSOsobaPlaceDataGridViewColumn.Name = "uxIznosSOsobaPlaceDataGridViewColumn";
			this.uxIznosSOsobaPlaceDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxIznosSOsobaPlaceDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxIznosSOsobaPlaceDataGridViewColumn.ReadOnly = false;		
			//
			// uxDnevnoRadnihSatiSOsobaplacaDataGridViewColumn
			//
			this.uxDnevnoRadnihSatiSOsobaplacaDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxDnevnoRadnihSatiSOsobaplacaDataGridViewColumn.DataPropertyName = "DnevnoRadnihSatiSOsobaplaca";
			this.uxDnevnoRadnihSatiSOsobaplacaDataGridViewColumn.HeaderText = "DnevnoRadnihSatiSOsobaplaca";
			this.uxDnevnoRadnihSatiSOsobaplacaDataGridViewColumn.Name = "uxDnevnoRadnihSatiSOsobaplacaDataGridViewColumn";
			this.uxDnevnoRadnihSatiSOsobaplacaDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxDnevnoRadnihSatiSOsobaplacaDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxDnevnoRadnihSatiSOsobaplacaDataGridViewColumn.ReadOnly = false;		
			//
			// uxOriginalniIznosDataGridViewColumn
			//
			this.uxOriginalniIznosDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxOriginalniIznosDataGridViewColumn.DataPropertyName = "OriginalniIznos";
			this.uxOriginalniIznosDataGridViewColumn.HeaderText = "OriginalniIznos";
			this.uxOriginalniIznosDataGridViewColumn.Name = "uxOriginalniIznosDataGridViewColumn";
			this.uxOriginalniIznosDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxOriginalniIznosDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxOriginalniIznosDataGridViewColumn.ReadOnly = false;		
			//
			// uxDoprinosNaPlaceDataGridViewColumn
			//
			this.uxDoprinosNaPlaceDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxDoprinosNaPlaceDataGridViewColumn.DataPropertyName = "DoprinosNaPlace";
			this.uxDoprinosNaPlaceDataGridViewColumn.HeaderText = "DoprinosNaPlace";
			this.uxDoprinosNaPlaceDataGridViewColumn.Name = "uxDoprinosNaPlaceDataGridViewColumn";
			this.uxDoprinosNaPlaceDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxDoprinosNaPlaceDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxDoprinosNaPlaceDataGridViewColumn.ReadOnly = false;		
			//
			// uxIDObracunOsobaDataGridViewColumn
			//				
			this.uxIDObracunOsobaDataGridViewColumn.DisplayMember = "IDOsoba";	
			this.uxIDObracunOsobaDataGridViewColumn.ValueMember = "ID";	
			this.uxIDObracunOsobaDataGridViewColumn.DisplayStyleForCurrentCellOnly = true;
			//uxIDObracunOsobaDataGridViewColumn.DataSource = uxIDObracunOsobaBindingSource;				
				
			//
			// uxIDPrimanjeTipDataGridViewColumn
			//				
			this.uxIDPrimanjeTipDataGridViewColumn.DisplayMember = "Naziv";	
			this.uxIDPrimanjeTipDataGridViewColumn.ValueMember = "ID";	
			this.uxIDPrimanjeTipDataGridViewColumn.DisplayStyleForCurrentCellOnly = true;
			//uxIDPrimanjeTipDataGridViewColumn.DataSource = uxIDPrimanjeTipBindingSource;				
				
			
			// this
			this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
			this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
			this.Controls.Add(this.uxObracunOsobaPrimanjeDataGridView);
			this.Name = "ObracunOsobaPrimanjeDataGridView";
			this.Size = new System.Drawing.Size(470, 300);
			//((System.ComponentModel.ISupportInitialize)(this.uxIDObracunOsobaBindingSource)).EndInit();
			//((System.ComponentModel.ISupportInitialize)(this.uxIDPrimanjeTipBindingSource)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.uxObracunOsobaPrimanjeErrorProvider)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.uxObracunOsobaPrimanjeDataGridView)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.uxObracunOsobaPrimanjeBindingSource)).EndInit();
			this.ResumeLayout(false);
		}
		#endregion
				
		#region events
		
		/// <summary>
		/// Raised the CurrentEntityChanged event.
		/// </summary>
		protected void OnCurrentEntityChanged()
		{
			if (CurrentEntityChanged != null)
			{
				ObracunOsobaPrimanjeDataGridViewEventArgs args = new ObracunOsobaPrimanjeDataGridViewEventArgs();
				args.ObracunOsobaPrimanje = _currentObracunOsobaPrimanje;
				CurrentEntityChanged(this, args); 
			}
		}
		
		#endregion
		
		/// <summary>
		/// Strongly typed event 
		/// </summary>
		public class ObracunOsobaPrimanjeDataGridViewEventArgs : System.EventArgs
		{
			private Entities.ObracunOsobaPrimanje	_ObracunOsobaPrimanje;
	
			/// <summary>
			/// the  Entities.ObracunOsobaPrimanje instance.
			/// </summary>
			public Entities.ObracunOsobaPrimanje ObracunOsobaPrimanje
			{
				get { return _ObracunOsobaPrimanje; }
				set { _ObracunOsobaPrimanje = value; }
			}	
		}
		
		/// <summary>
		/// Handles the DataError event of the uxObracunOsobaPrimanjeDataGridView control.
		/// </summary>
		/// <param name="sender">The source of the event.</param>
		/// <param name="e">The <see cref="T:System.Windows.Forms.DataGridViewDataErrorEventArgs"/> instance containing the event data.</param>
		protected void OnObracunOsobaPrimanjeDataGridViewDataError(object sender, System.Windows.Forms.DataGridViewDataErrorEventArgs e)
		{
			System.Diagnostics.Debug.WriteLine(string.Format( "{0}, {1}", e.ColumnIndex, e.RowIndex));
		}
		
		/// <summary>
		/// Handles the CellValueNeeded event of the uxObracunOsobaPrimanjeDataGridView control.
		/// </summary>
		/// <param name="sender">The source of the event.</param>
		/// <param name="e">The <see cref="T:System.Windows.Forms.DataGridViewCellValueEventArgs"/> instance containing the event data.</param>
		protected void OnObracunOsobaPrimanjeDataGridViewCellValueNeeded(object sender, System.Windows.Forms.DataGridViewCellValueEventArgs e)
		{
			switch(uxObracunOsobaPrimanjeDataGridView.Columns[e.ColumnIndex].Name)
			{
					case "uxIDDataGridViewColumn":
						e.Value = ObracunOsobaPrimanjeList[e.RowIndex].ID;
						break;
					case "uxIDObracunOsobaDataGridViewColumn":
						e.Value = ObracunOsobaPrimanjeList[e.RowIndex].IDObracunOsoba;
						break;
					case "uxIDPrimanjeTipDataGridViewColumn":
						e.Value = ObracunOsobaPrimanjeList[e.RowIndex].IDPrimanjeTip;
						break;
					case "uxSatiDataGridViewColumn":
						e.Value = ObracunOsobaPrimanjeList[e.RowIndex].Sati;
						break;
					case "uxPostotakDataGridViewColumn":
						e.Value = ObracunOsobaPrimanjeList[e.RowIndex].Postotak;
						break;
					case "uxSatnicaDataGridViewColumn":
						e.Value = ObracunOsobaPrimanjeList[e.RowIndex].Satnica;
						break;
					case "uxDatumOdDataGridViewColumn":
						e.Value = ObracunOsobaPrimanjeList[e.RowIndex].DatumOd;
						break;
					case "uxDatumDoDataGridViewColumn":
						e.Value = ObracunOsobaPrimanjeList[e.RowIndex].DatumDo;
						break;
					case "uxIznosDataGridViewColumn":
						e.Value = ObracunOsobaPrimanjeList[e.RowIndex].Iznos;
						break;
					case "uxStazMjeseci1DataGridViewColumn":
						e.Value = ObracunOsobaPrimanjeList[e.RowIndex].StazMjeseci1;
						break;
					case "uxStazMjeseci2DataGridViewColumn":
						e.Value = ObracunOsobaPrimanjeList[e.RowIndex].StazMjeseci2;
						break;
					case "uxMIO1DataGridViewColumn":
						e.Value = ObracunOsobaPrimanjeList[e.RowIndex].MIO1;
						break;
					case "uxMIO2DataGridViewColumn":
						e.Value = ObracunOsobaPrimanjeList[e.RowIndex].MIO2;
						break;
					case "uxBrojDanaInozemstvaDataGridViewColumn":
						e.Value = ObracunOsobaPrimanjeList[e.RowIndex].BrojDanaInozemstva;
						break;
					case "uxStazSPovecanimTrajanjemRegosDataGridViewColumn":
						e.Value = ObracunOsobaPrimanjeList[e.RowIndex].StazSPovecanimTrajanjemRegos;
						break;
					case "uxIznosSOsobaPlaceDataGridViewColumn":
						e.Value = ObracunOsobaPrimanjeList[e.RowIndex].IznosSOsobaPlace;
						break;
					case "uxDnevnoRadnihSatiSOsobaplacaDataGridViewColumn":
						e.Value = ObracunOsobaPrimanjeList[e.RowIndex].DnevnoRadnihSatiSOsobaplaca;
						break;
					case "uxOriginalniIznosDataGridViewColumn":
						e.Value = ObracunOsobaPrimanjeList[e.RowIndex].OriginalniIznos;
						break;
					case "uxDoprinosNaPlaceDataGridViewColumn":
						e.Value = ObracunOsobaPrimanjeList[e.RowIndex].DoprinosNaPlace;
						break;
				default:
				break;
			}
		}
		
		/// <summary>
		/// Handles the CellValuePushed event of the uxObracunOsobaPrimanjeDataGridView control.
		/// </summary>
		/// <param name="sender">The source of the event.</param>
		/// <param name="e">The <see cref="T:System.Windows.Forms.DataGridViewCellValueEventArgs"/> instance containing the event data.</param>
		protected void OnObracunOsobaPrimanjeDataGridViewCellValuePushed(object sender, System.Windows.Forms.DataGridViewCellValueEventArgs e)
		{
			switch(uxObracunOsobaPrimanjeDataGridView.Columns[e.ColumnIndex].Name)
			{
					case "uxIDDataGridViewColumn":
						ObracunOsobaPrimanjeList[e.RowIndex].ID = (System.Int32)e.Value;
						break;
					case "uxIDObracunOsobaDataGridViewColumn":
						ObracunOsobaPrimanjeList[e.RowIndex].IDObracunOsoba = (System.Int32)e.Value;
						break;
					case "uxIDPrimanjeTipDataGridViewColumn":
						ObracunOsobaPrimanjeList[e.RowIndex].IDPrimanjeTip = (System.Int32)e.Value;
						break;
					case "uxSatiDataGridViewColumn":
						ObracunOsobaPrimanjeList[e.RowIndex].Sati = (System.Decimal?)e.Value;
						break;
					case "uxPostotakDataGridViewColumn":
						ObracunOsobaPrimanjeList[e.RowIndex].Postotak = (System.Decimal?)e.Value;
						break;
					case "uxSatnicaDataGridViewColumn":
						ObracunOsobaPrimanjeList[e.RowIndex].Satnica = (System.Single?)e.Value;
						break;
					case "uxDatumOdDataGridViewColumn":
						ObracunOsobaPrimanjeList[e.RowIndex].DatumOd = (System.DateTime)e.Value;
						break;
					case "uxDatumDoDataGridViewColumn":
						ObracunOsobaPrimanjeList[e.RowIndex].DatumDo = (System.DateTime)e.Value;
						break;
					case "uxIznosDataGridViewColumn":
						ObracunOsobaPrimanjeList[e.RowIndex].Iznos = (System.Decimal?)e.Value;
						break;
					case "uxStazMjeseci1DataGridViewColumn":
						ObracunOsobaPrimanjeList[e.RowIndex].StazMjeseci1 = (System.Int32)e.Value;
						break;
					case "uxStazMjeseci2DataGridViewColumn":
						ObracunOsobaPrimanjeList[e.RowIndex].StazMjeseci2 = (System.Int32)e.Value;
						break;
					case "uxMIO1DataGridViewColumn":
						ObracunOsobaPrimanjeList[e.RowIndex].MIO1 = (System.Boolean)e.Value;
						break;
					case "uxMIO2DataGridViewColumn":
						ObracunOsobaPrimanjeList[e.RowIndex].MIO2 = (System.Boolean)e.Value;
						break;
					case "uxBrojDanaInozemstvaDataGridViewColumn":
						ObracunOsobaPrimanjeList[e.RowIndex].BrojDanaInozemstva = (System.Int32)e.Value;
						break;
					case "uxStazSPovecanimTrajanjemRegosDataGridViewColumn":
						ObracunOsobaPrimanjeList[e.RowIndex].StazSPovecanimTrajanjemRegos = (System.Int32)e.Value;
						break;
					case "uxIznosSOsobaPlaceDataGridViewColumn":
						ObracunOsobaPrimanjeList[e.RowIndex].IznosSOsobaPlace = (System.Decimal)e.Value;
						break;
					case "uxDnevnoRadnihSatiSOsobaplacaDataGridViewColumn":
						ObracunOsobaPrimanjeList[e.RowIndex].DnevnoRadnihSatiSOsobaplaca = (System.Decimal)e.Value;
						break;
					case "uxOriginalniIznosDataGridViewColumn":
						ObracunOsobaPrimanjeList[e.RowIndex].OriginalniIznos = (System.Decimal?)e.Value;
						break;
					case "uxDoprinosNaPlaceDataGridViewColumn":
						ObracunOsobaPrimanjeList[e.RowIndex].DoprinosNaPlace = (System.Boolean)e.Value;
						break;
				default:
				break;
			}
		}
	}
}
